#include<stdio.h>
#include <stdlib.h>

int Fib(int n)
{
    int* arr= (int*)malloc((n + 1) * sizeof(int));
    for (int i = 2; i <= n; i++) {
        arr[0] = 0; arr[1] = 1;
        arr[i] = arr[i - 1] + arr[i - 2];  // 计算斐波那契数列的每个项  
    }
    return arr[n];  // 返回第n个斐波那契数  
}
   
   
   
  

int main(){
    int i;
    printf("输入要查询的数列项数：");
    scanf("%d",&i);
    printf("第%d项是%d",i,Fib(i));
    return 0;
}